package com.jiugang.cardump.util;

import com.jiugang.cardump.result.ResultInfoV110;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName TypeEnum
 * @Description TypeEnum
 * @Author luoxin
 * @Date 2021/8/19 5:13 下午
 */
@Getter

public enum TypeEnum {
    DUIGUIZHAUNGTAI_ZERO("0","对轨完成","DGZT"),
    DUIGUIZHAUNGTAI_ONE("1","对轨报警","DGZT"),
    DUIGUIZHAUNGTAI_TWO("2","翻转作业中","DGZT"),
    YACHEZHUANGTAI_ZERO("0","压车完成","YCZT"),
    YACHEZHUANGTAI_ONE("1","压车报警","YCZT"),
    YACHEZHUANGTAI_TWO("2","压车作业中","YCZT"),
    YACHEZHUANGTAI_THREE("3","无动作","YCZT"),
    GUAGOUZHUANGTAI_ZERO("0","位置正确","GGZT"),
    GUAGOUZHUANGTAI_ONE("1","偏差报警","GGZT"),
    GUAGOUZHUANGTAI_TWO("2","位置调整中","GGZT"),
    DUIGUIJIGUANGXINHAO_ZERO("0","未对齐","DGJGXH"),
    DUIGUIJIGUANGXINHAO_ONE("1","对齐","DGJGXH"),
    YACHEBIONE_ZERO("0","未压紧","YCBXH1"),
    YACHEBIONE_ONE("1","压紧","YCBXH1"),
    YACHEBITWO_ZERO("0","未压紧","YCBXH2"),
    YACHEBITWO_ONE("1","压紧","YCBXH2"),
    YACHEBITHREE_ZERO("0","未压紧","YCBXH3"),
    YACHEBITHREE_ONE("1","压紧","YCBXH3"),
    YACHEBIFOUR_ZERO("0","未压紧","YCBXH4"),
    YACHEBIFOUR_ONE("1","压紧","YCBXH4"),
    AISHIBIEXINHAO_ZERO("0","居中","AIXBXH"),
    AISHIBIEXINHAO_ONE("1","未居中","AIXBXH"),
    AISHIBIEXINHAO_TWO("2","翻转中","AIXBXH"),
    AISHIBIEXINHAO_THREE("3","无车厢","AIXBXH"),
    CUOWU(null,"数据错误",null);


    private String number;
    private String value;
    private String status;


    TypeEnum(String number, String value,String status) {
        this.value = value;
        this.number = number;
        this.status = status;
    }

    public static String getTarget(String value,String status){
        for (TypeEnum typeEnum:values()){
            if (typeEnum.number.equals(value)  && typeEnum.status.equals(status)){
                return typeEnum.value;
            }
        }
        return CUOWU.value;
    }

}
